/**
 * 
 */
package edu.gatech.oad.mule.view;

import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.JLabel;
import javax.swing.JPanel;

import edu.gatech.oad.mule.view.interfaces.RenderableGameDriver;

/**
 * @author Dale Avery
 *
 */
final class ProductionPanel extends JPanel {
	
	private RenderableGameDriver driver;
	private JLabel status;

	/**
	 * Constructs a new ProductionPanel.
	 * @param dimension The desired size of this panel.
	 * @param gameDriver The source of game information.
	 */
	public ProductionPanel(Dimension dimension, RenderableGameDriver gameDriver) {
		this.driver = gameDriver;
		status = new JLabel();
		this.add(status);
		this.setPreferredSize(dimension);
	}
	
	@Override
	public void paintComponent(Graphics g) {
		// Let UI Delegate paint first, which
		// includes background filling since
		// this component is opaque.

		super.paintComponent(g);
	
		// Draw which player is receiving production.
		status.setText("Calculating production for player: " + driver.getCurrentPlayer());
	}

}
